import React, { Component } from 'react';
import Header from '../../components/Header'
import { connect } from 'react-redux';
import {Button} from 'antd-mobile'
import { NavLink } from 'react-router-dom';
class Index extends Component {
  render() {
    return (
      <div className='box'>
          <Header title='我的' />
          <div className='content'>内容
            {this.props.loginState ? <Button onClick={()=>{
              localStorage.clear()
              window.location.href = '/#/login'
            }}>退出登录</Button> : <NavLink to={'/login'}>去登录</NavLink>}
          </div>
        </div>
    );
  }
}

export default connect((state)=>{
  return {
    loginState: state.getIn(['user', 'loginState'])
  }
},null)(Index);
